<template>
    <div class="bgf padt40 padb40" v-loading.fullscreen.lock="fullscreenLoading">
        <el-form :model="form" label-width="120px" :rules="rules">

            <el-form-item label="文章标题：" prop="title">
                <el-input v-model="form.title" placeholder="请输入60个字以内的文章标题" class="w460" />
            </el-form-item>

            <el-form-item label="文章排序：" prop="sort">
                <el-input v-model="form.sort" placeholder="请输入排序" class="w100" />
            </el-form-item>

            <el-form-item label=" "  >
                <div class="editor">
                    <div ref="editor"></div>
                </div>
            </el-form-item>

            <el-form-item>
                <el-button class="w140" type="primary" @click="submit" >确认提交</el-button>
            </el-form-item>

        </el-form>
    </div>
   


</template>
<script>
    import editor from "../../components/Editor.vue"

export default {
    props: {
        message: String
    },
    data() {
        return {
            id: this.$route.params.id,
            dialogShow: true,
            id: '',
            loading: false,
            form: {}, content: '',
            classificationL: [],
            param: {},
            uploadUrl: `/api/system/upload/uploadList`,
        }
    },

    created() {
    },

    mounted() {
        this.form=this.message;
        console.log(this.message)
    },

    components: {
editor,
    },

    methods: {
        changeEditor(html) {
            this.content = html;
            this.form.content2 = html
        },



        clickOff(){
           this.$parent.dialogShow388 = false;
           this.dialogShow = false;
        },



        submit() {
            console.log(this.form, 'this.form=============')
            let that = this;
            that.$parent.dialogShow = false
            that.$refs['submitForm'].validate((val) => {
                if (val) {
                    let form = JSON.parse(JSON.stringify(that.form))
                        that.$api.updatearticle(form).then(res => {
                    that.fullscreenLoading = false;
                    console.log(res);
                    if (res) {
                        that.$message.success(res.message);
                        this.$parent.dialogShow1 = false;
                        this.dialogShow = true;
                    }
                    });
                }
            })
        },



    }

}


</script>
<style lang="scss" scoped>

.div1{
    background-color: #fff;
    padding: 25px;
    box-sizing: border-box;
}
.buttons1{
    width: 100%;
    display: flex;
    justify-content: center;
    .buttons1_button1{
        width: 200px;
        height: 50px;
    }
}
.dialog1_title1 {
    display: inline-block;
    font-size: 12px;
    color: #9e9e9e;
    width: 100%;
}

.dialog1_prompt1 {
    display: inline-block;
    color: #9e9e9e;
    line-height: 20px;
    padding-top: 10px;
    font-size: 12px;
    text-align: left;
    width: 100%;
}

.dialog1_prompt2 {
    display: inline-block;
    color: #9e9e9e;
    line-height: 20px;
    padding-top: 10px;
    font-size: 12px;
    text-align: left;
    width: 100%;
}

.dialog1_video1 {
    width: 500px;
}

.dialog1_img1 {
    width: 300px;
}

.dialog1_img2 {
    width: 100px;
    height: 100px;
    margin-right: 20px;
}

</style>